#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START flex-native

save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
export CFLAGS='-O2 -g'
unset CPPFLAGS
unset LDFLAGS

reset_mtime flex flex/configure.ac
mkdir -p build/flex-native
cd build/flex-native
env \
	-u CPPFLAGS \
	-u LDFLAGS \
	CFLAGS="-O2 -g" \
../../flex/configure \
	--host="$BUILD" \
	--build="$BUILD" \
	--prefix="${build_prefix}" \
	--disable-shared \
	${AUTOCRAP_KLUDGE}

cd ../..
make_native_build build/flex-native

export CFLAGS="$save_CFLAGS"
export CPPFLAGS="$save_CPPFLAGS"
export LDFLAGS="$save_LDFLAGS"

# RECIPE END flex-native
